import request from '@/utils/request'
export function getCategories(params) {
    return request({
        url: '/categories',
        params
    })
}

export function deleteCategory(id) {
    return request({
        url: `/categories/${id}`,
        method: 'delete'
    })
}

export function addCategory(data) {
    return request({
        url: '/categories',
        method: 'post',
        data
    })
}

export function selectCategory(id) {
    return request({
        url: `/categories/${id}`,
        method: 'get'
    })
}

export function updateCategory(data) {
    return request({
        url: '/categories',
        method: 'put',
        data
    })
}